
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports _2bMatesSite.BO
Imports _2bMatesSite.Controls


Namespace _2bMatesSite
	''' <summary>
	''' Summary description for edit_group_events.
	''' </summary>
	Public Partial Class edit_group_events
		Inherits BaseWebPage
		Private MIN_YEAR As Integer = Constants.MIN_YEAR_EVENT
		Private MAX_YEAR As Integer = Constants.MAX_YEAR_EVENT
		Protected tblTopTable As System.Web.UI.WebControls.Table
		Protected grpEvents As ArrayList = Nothing
		Protected grpID As Integer = -1
		Protected id As Integer = -1
		Protected usr As User = Nothing
		Protected grp As Group = Nothing
		Protected grpEvent As GroupEvent = Nothing
		Protected lblEditGroup As System.Web.UI.WebControls.Label
		Protected nGroupEventsCount As Double = 0
		Protected htPageConstants As New Hashtable()

		Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
			' Put user code to initialize the page here
			Dim action As Integer = -1
			usr = LoggedUser
			If usr = Nothing Then
				Common.Utils.RedirectToLoginPage(Page)
			End If

			Me.initPageTitles(Constants.EDIT_GROUP_EVENTS, "", Form1, Nothing, htPageConstants)
			Me.initAdvertisements(Form1, Nothing)

			If Request.Params(Constants.GROUP_PARAM) = Nothing OrElse Request.Params(Constants.GROUP_PARAM) = "" Then
				Throw New Exception(Constants.ERROR_MESSAGE_MISSING_PARAMETERS)
			End If

			If Constants.SHOW_GROUPS <> Constants.SHOW_ON Then
				Throw New Exception(Constants.ERROR_MESSAGE_NO_ACCESS)
			End If

			Try
				grpID = Convert.ToInt32(Request.Params(Constants.GROUP_PARAM))
				grp = Groups.GetGroupByID(grpID)

				If grp = Nothing Then
					Throw New Exception(Constants.ERROR_MESSAGE_GROUP_DOESNT_EXIST_ERROR)
				End If

				grpEvents = GroupEvents.LoadGroupEvents(grpID)
				nGroupEventsCount = grpEvents.Count

				If Request.Params("id") <> Nothing AndAlso Request.Params("id") <> "" Then
					id = Convert.ToInt32(Request.Params("id"))
				End If

				' init action
				If Request.Params(Constants.GROUP_EVENT_ACTION_PARAM) <> Nothing AndAlso Request.Params(Constants.GROUP_EVENT_ACTION_PARAM) <> "" Then
					action = Convert.ToInt32(Request.Params(Constants.GROUP_EVENT_ACTION_PARAM))
				End If
			Catch
				Throw New Exception(Constants.ERROR_MESSAGE_MISSING_PARAMETERS)
			End Try

			' check if Logged user is the moderator of the group
			If grp.Uid <> usr.ID Then
				Throw New Exception(Constants.ERROR_MESSAGE_ONLY_MODERATOR_ACCESS)
			End If

			Dim i As Integer

			If nGroupEventsCount = 0 Then
				dgGroupEvents.Visible = False
				trUpperPager.Visible = False
				trBottomPager.Visible = False
				trEventsTitle.Visible = False
			Else
				' switch off validation
				dgPager.ValidationOn = False
				dgPagerUp.ValidationOn = False

				' init Pagers
				dgPager.RedirectPage = Constants.EDIT_GROUP_EVENTS + "?" + Constants.GROUP_PARAM + "=" + grp.ID
				dgPager.MaxPageNumber = Convert.ToInt32(Math.Ceiling(nGroupEventsCount / Constants.MAX_GRID_EVENTS_ON_EDIT_PAGE))
				dgPager.Action = "-1"

				dgPagerUp.RedirectPage = Constants.EDIT_GROUP_EVENTS + "?" + Constants.GROUP_PARAM + "=" + grp.ID
				dgPagerUp.MaxPageNumber = Convert.ToInt32(Math.Ceiling(nGroupEventsCount / Constants.MAX_GRID_EVENTS_ON_EDIT_PAGE))
				dgPagerUp.Action = "-1"

				If id > 0 Then
					dgPagerUp.RedirectPage += "&id=" + id
					dgPager.RedirectPage += "&id=" + id
				End If

				' initialize listing literals

				dgPager.dgListing.TotalCount = Convert.ToInt32(nGroupEventsCount)
				dgPagerUp.dgListing.TotalCount = Convert.ToInt32(nGroupEventsCount)

				'initialize current page number
				If Convert.ToInt32(Request.Params("page")) = 0 OrElse dgPager.CurrentPageNumber = 1 Then
					dgPager.CurrentPageNumber = 1
					dgPagerUp.CurrentPageNumber = 1
					ViewState("StartIndex") = 0
				Else
					dgPager.CurrentPageNumber = Convert.ToInt32(Request.Params("page"))
					dgPagerUp.CurrentPageNumber = Convert.ToInt32(Request.Params("page"))
					ViewState("StartIndex") = (dgPager.CurrentPageNumber - 1) * Constants.MAX_GRID_EVENTS_ON_EDIT_PAGE
				End If

				dgPager.PagesRest = dgPager.MaxPageNumber - dgPager.FirstPageNumber + 1
				dgPager.LastPageNumber = Math.Min(dgPager.PagesRest, Constants.MAX_PAGES_NUMS_ON_PAGE)
				dgPagerUp.PagesRest = dgPagerUp.MaxPageNumber - dgPagerUp.FirstPageNumber + 1
				dgPagerUp.LastPageNumber = Math.Min(dgPagerUp.PagesRest, Constants.MAX_PAGES_NUMS_ON_PAGE)
			End If

			' init message
			Select Case action
				Case Constants.GROUP_EVENT_ACTION_ADD_NEW
					lblChangesSubmitted.Text = Me.GetPageConstText(htPageConstants, "CONST_MsgAdded_TEXT")
					lblChangesSubmitted.Visible = True
					Exit Select
				Case Constants.GROUP_EVENT_ACTION_EDIT
					lblChangesSubmitted.Text = Me.GetPageConstText(htPageConstants, "CONST_MsgUpdated_TEXT")
					lblChangesSubmitted.Visible = True
					Exit Select
				Case Constants.GROUP_EVENT_ACTION_DELETE
					lblChangesSubmitted.Text = Me.GetPageConstText(htPageConstants, "CONST_MsgDeleted_TEXT")
					lblChangesSubmitted.Visible = True
					Exit Select
				Case Else
					lblChangesSubmitted.Visible = False
					Exit Select
			End Select

			' init right links
			Dim sLinkText As String = (Me.GetPageConstText(htPageConstants, "CONST_ViewGroup_TEXT")).Replace("[PARAM]", grp.Name)
			litRightLinks.Text = "<a href=""" + Constants.GROUP + "?" + Constants.GROUP_PARAM + "=" + grp.ID + """ class=""white_link"">" + sLinkText + "</a>"

			If Not Me.IsPostBack Then
				dgGroupEvents.VirtualItemCount = Convert.ToInt32(nGroupEventsCount)
				BindGrid()

				i = 1
				While i <= 31
					ddlDay.Items.Add(i.ToString())
					System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
				End While
				' Fill in Months
				Dim months As String() = Constants.ARR_MONTHS
				i = 1
				While i <= 12
					ddlMonth.Items.Add(months(i - 1))
					ddlMonth.Items.FindByText(months(i - 1)).Value = i.ToString()
					System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
				End While
				' Fill in Years
				i = MAX_YEAR
				While i >= MIN_YEAR
					ddlYear.Items.Add(i.ToString())
					System.Math.Max(System.Threading.Interlocked.Decrement(i),i + 1)
				End While
				' Fill in hours
				i = 1
				While i <= 12
					ddlHours.Items.Add(i.ToString())
					System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
				End While
				' Fill in minutes
				ddlMinutes.Items.Add("00")
				ddlMinutes.Items.Add("15")
				ddlMinutes.Items.Add("30")
				ddlMinutes.Items.Add("45")
				'Fill in PM/AM
				ddlTime.Items.Add("AM")
				ddlTime.Items.Add("PM")

				' init countries dropdown

				Dim countriesCount As Integer = Constants.COUNTRIES.List.Count
				Dim tempCountry As Countries.Country

				i = 0
				While i < countriesCount
					tempCountry = DirectCast(Constants.COUNTRIES.List(i), Countries.Country)
					ddlCountry.Items.Add(tempCountry.Name)
					ddlCountry.Items.FindByText(tempCountry.Name).Value = tempCountry.ID.ToString()
					System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
				End While

				' init Top links
				hlEditGroupProfile.NavigateUrl = "../" + Constants.EDIT_GROUP_BASIC + "?" + Constants.GROUP_PARAM + "=" + grp.ID
				hlCancelGroup.NavigateUrl = "../" + Constants.CANCEL_ACCOUNT + "?" + Constants.GROUP_PARAM + "=" + grp.ID
				hlBands.NavigateUrl = "../" + Constants.EDIT_GROUP_BANDS + "?" + Constants.GROUP_PARAM + "=" + grp.ID

				If id > 0 Then
					grpEvent = GroupEvents.GetGroupEventByID(id)
				End If

				If grpEvent <> Nothing Then
					Dim eventDate As DateTime = grpEvent.DateTimeEvent
					Dim day As String = eventDate.Day.ToString()
					Dim month As String = eventDate.Month.ToString()
					Dim year As String = eventDate.Year.ToString()
					ddlDay.Items.FindByValue(day).Selected = True
					ddlMonth.Items.FindByValue(month).Selected = True
					ddlYear.Items.FindByValue(year).Selected = True
					Dim hour As String = eventDate.ToString(" h").Trim()
					Dim minutes As String = eventDate.ToString("mm")
					ddlMinutes.Items.FindByValue(minutes).Selected = True
					ddlHours.Items.FindByValue(hour).Selected = True
					Dim time As String = eventDate.ToString("tt")
					ddlTime.Items.FindByValue(time).Selected = True

					txtVenue.Text = grpEvent.Venue
					txtCost.Text = grpEvent.Cost
					txtAddress.Text = grpEvent.Address
					txtCity.Text = grpEvent.City
					txtZipCode.Text = grpEvent.ZipCode
					ddlCountry.ClearSelection()
					ddlCountry.Items.FindByValue(grpEvent.CountryID.ToString()).Selected = True
					txtDetails.Text = grpEvent.Details
				Else
					ddlCountry.ClearSelection()
					ddlCountry.Items.FindByValue(Countries.UKID.ToString()).Selected = True
				End If
				txtDetails.Attributes.Add("onKeyDown", Constants.ON_KEY_DOWN_SCRIPT.Replace(Constants.TEXT_AREA_MAX_CHARS_TAG, Constants.TEXT_FIELD_GE_DETAILS_MAX_CHARS.ToString()))
				txtDetails.Attributes.Add("onKeyUp", Constants.ON_KEY_UP_SCRIPT.Replace(Constants.TEXT_AREA_MAX_CHARS_TAG, Constants.TEXT_FIELD_GE_DETAILS_MAX_CHARS.ToString()))
			End If
		End Sub

		#region Web Form Designer generated code
		Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
			'
			' CODEGEN: This call is required by the ASP.NET Web Form Designer.
			'
			InitializeComponent()
			MyBase.OnInit(e)
		End Sub

		''' <summary>
		''' Required method for Designer support - do not modify
		''' the contents of this method with the code editor.
		''' </summary>
		Private Sub InitializeComponent()
			AddHandler Me.cvHtmlInVenue.ServerValidate, AddressOf Me.cvHtmlInVenue_ServerValidate
			AddHandler Me.cvHtmlInCost.ServerValidate, AddressOf Me.cvHtmlInCost_ServerValidate
			AddHandler Me.cvHtmlInAddress.ServerValidate, AddressOf Me.cvHtmlInAddress_ServerValidate
			AddHandler Me.cvHtmlInCity.ServerValidate, AddressOf Me.cvHtmlInCity_ServerValidate
			AddHandler Me.cvHtmlInZipCode.ServerValidate, AddressOf Me.cvHtmlInZipCode_ServerValidate
			AddHandler Me.valVenue.ServerValidate, AddressOf Me.isVenue
			AddHandler Me.valCity.ServerValidate, AddressOf Me.isCity
			AddHandler Me.cvZip.ServerValidate, AddressOf Me.cvZip_ServerValidate
			AddHandler Me.dgGroupEvents.ItemCommand, AddressOf Me.dgGroupEvents_ItemCommand

		End Sub
#End Region

		Protected Sub validateDate(ByVal sender As Object, ByVal args As ServerValidateEventArgs)
			Dim day As String = ddlDay.SelectedItem.Value
			Dim month As String = ddlMonth.SelectedItem.Value
			Dim year As String = ddlYear.SelectedItem.Value
			Dim hour As String = ddlHours.SelectedItem.Value
			Dim minutes As String = ddlMinutes.SelectedItem.Value
			Dim time As String = ddlTime.SelectedItem.Value
			If day <> "0" AndAlso month <> "0" AndAlso year <> "0" AndAlso hour <> "0" AndAlso minutes <> "0" AndAlso time <> "0" Then
				If Not isDate(day, month, year) Then
					args.IsValid = False
				Else
					args.IsValid = True
				End If
			Else
				args.IsValid = False
			End If
		End Sub

		Protected Function isDate(ByVal strDay As String, ByVal strMonth As String, ByVal strYear As String) As Boolean
			Dim validDate As Boolean = False

			Try
				' try creating the date
				New DateTime(Convert.ToInt32(strYear), Convert.ToInt32(strMonth), Convert.ToInt32(strDay))
				validDate = True
			Catch
			End Try
			Return validDate
		End Function

		Protected Sub isVenue(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
			If Request.Params(txtVenue.UniqueID) = "" Then
				args.IsValid = False
			Else
				args.IsValid = True
			End If
		End Sub

		Protected Sub isCity(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
			If Request.Params(txtCity.UniqueID) = "" Then
				args.IsValid = False
			Else
				args.IsValid = True
			End If
		End Sub

		Private Sub cvZip_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
			Dim countryID As Integer = Convert.ToInt32(Request.Params(ddlCountry.UniqueID))
			If (countryID = Countries.USAID OrElse countryID = Countries.CANADAID) AndAlso Request.Params(txtZipCode.UniqueID) = "" Then
				args.IsValid = False
			Else
				args.IsValid = True
			End If
		End Sub

		Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs)
			If Page.IsValid Then
				Dim temp As String = ""
				Dim action As Integer = -1
				Dim grpEvent As GroupEvent = GroupEvents.GetGroupEventByID(id)
				If grpEvent = Nothing Then
					grpEvent = New GroupEvent(grpID)
					action = Constants.GROUP_EVENT_ACTION_ADD_NEW
				Else
					action = Constants.GROUP_EVENT_ACTION_EDIT
				End If

				Dim tempHours As Integer = Convert.ToInt32(Request.Params(ddlHours.UniqueID))
				If Request.Params(ddlTime.UniqueID) = "PM" Then
					tempHours += 12
				End If
				grpEvent.DateTimeEvent = New DateTime(Convert.ToInt32(Request.Params(ddlYear.UniqueID)), Convert.ToInt32(Request.Params(ddlMonth.UniqueID)), Convert.ToInt32(Request.Params(ddlDay.UniqueID)), tempHours, Convert.ToInt32(Request.Params(ddlMinutes.UniqueID)), 0)
				temp = removeScriptTags(Request.Params(txtVenue.UniqueID).Trim())
				grpEvent.Venue = temp.Substring(0, Math.Min(temp.Length, Constants.TEXT_AREA_GROUP_MAX_CHARS))

				temp = removeScriptTags(Request.Params(txtCost.UniqueID).Trim())
				grpEvent.Cost = temp.Substring(0, Math.Min(temp.Length, Constants.TEXT_FIELD_DEFAULT_MAX_CHARS))

				temp = removeScriptTags(Request.Params(txtAddress.UniqueID).Trim())
				grpEvent.Address = temp.Substring(0, Math.Min(temp.Length, Constants.TEXT_FIELD_ADDRESS_MAX_CHARS))

				temp = removeScriptTags(Request.Params(txtCity.UniqueID).Trim())
				grpEvent.City = temp.Substring(0, Math.Min(temp.Length, Constants.TEXT_FIELD_DEFAULT_MAX_CHARS))

				temp = removeScriptTags(Request.Params(txtZipCode.UniqueID).Trim())
				grpEvent.ZipCode = temp.Substring(0, Math.Min(temp.Length, Constants.TEXT_FIELD_ZIPCODE_CHARS))

				temp = removeScriptTags(Request.Params(txtDetails.UniqueID).Trim())
				grpEvent.Details = temp.Substring(0, Math.Min(temp.Length, Constants.TEXT_FIELD_GE_DETAILS_MAX_CHARS))

				grpEvent.CountryID = Convert.ToInt32(Request.Params(ddlCountry.UniqueID).Trim())

				grpEvent.Save()
				Response.Redirect(Constants.EDIT_GROUP_EVENTS + "?" + Constants.GROUP_PARAM + "=" + grpID + "&" + Constants.GROUP_EVENT_ACTION_PARAM + "=" + action)
			Else
				lblChangesSubmitted.Visible = False
			End If
		End Sub

		Private Sub dgGroupEvents_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)
			Dim src As Object = e.CommandSource
			Dim srcType As String = src.[GetType]().ToString()
			Dim cmd As String = e.CommandName

			Select Case cmd
				Case "Edit"
					Response.Redirect(Constants.EDIT_GROUP_EVENTS + "?" + Constants.GROUP_PARAM + "=" + grpID + "&id=" + e.CommandArgument)
					Exit Select
				Case "Delete"
					grpEvent = GroupEvents.GetGroupEventByID(Convert.ToInt32(e.CommandArgument))
					grpEvent.DoDelete()
					Response.Redirect(Constants.EDIT_GROUP_EVENTS + "?" + Constants.GROUP_PARAM + "=" + grpID + "&" + Constants.GROUP_EVENT_ACTION_PARAM + "=" + Constants.GROUP_EVENT_ACTION_DELETE + "&#")
					Exit Select
			End Select
		End Sub

		Protected Function CreateDataSource() As ICollection
			Dim dt As New DataTable()

			If grpEvents.Count <= 0 Then
				dgPager.FirstPageNumber = 1
				dgPager.LastPageNumber = 1
				dgPager.MaxPageNumber = 1
				dgPager.PagesRest = 1
				dgPager.dgListing.StartIndex = 0
				dgPager.dgListing.EndIndex = 0
				dgPagerUp.FirstPageNumber = 1
				dgPagerUp.LastPageNumber = 1
				dgPagerUp.MaxPageNumber = 1
				dgPagerUp.PagesRest = 1
				dgPagerUp.dgListing.StartIndex = 0
				dgPagerUp.dgListing.EndIndex = 0
				dgGroupEvents.AllowSorting = False
			Else
				Dim startIndex As Integer = Convert.ToInt32(ViewState("StartIndex"))
				Dim endIndex As Integer = startIndex + Constants.MAX_GRID_EVENTS_ON_EDIT_PAGE
				Dim t As Integer = 0
				Dim counter As Integer = 0
				endIndex = Math.Min(endIndex, Convert.ToInt32(nGroupEventsCount))
				t = (endIndex - startIndex)
				dgPager.dgListing.StartIndex = startIndex + 1
				dgPager.dgListing.EndIndex = endIndex
				dgPagerUp.dgListing.StartIndex = startIndex + 1
				dgPagerUp.dgListing.EndIndex = endIndex

				Dim dr As DataRow

				dt.Columns.Add(New DataColumn("ID", GetType(Integer)))
				dt.Columns.Add(New DataColumn("EventDate", GetType(String)))
				dt.Columns.Add(New DataColumn("EventTime", GetType(String)))
				dt.Columns.Add(New DataColumn("Venue", GetType(String)))
				dt.Columns.Add(New DataColumn("Address", GetType(String)))
				dt.Columns.Add(New DataColumn("City", GetType(String)))
				dt.Columns.Add(New DataColumn("ZipCode", GetType(String)))
				dt.Columns.Add(New DataColumn("Cost", GetType(String)))
				dt.Columns.Add(New DataColumn("Details", GetType(String)))
				dt.Columns.Add(New DataColumn("DelGroupEventVisibility", GetType(Boolean)))

				' List group events
				For Each result As GroupEvent In grpEvents
					If counter >= startIndex AndAlso counter < endIndex Then
						dr = dt.NewRow()
						dr(0) = result.ID

						dr = dt.NewRow()
						dr(0) = result.ID
						If result.DateTimeEvent.ToString() <> Nothing Then
							' Add date / time
							dr(1) = result.DateTimeEvent.ToString("dddd, MMMM dd yyyy")
						Else
							dr(1) = ""
						End If
						If result.Venue <> Nothing Then
							dr(2) = result.DateTimeEvent.ToString("h:mm tt")
						Else
							dr(2) = ""
						End If
						If result.Venue <> Nothing Then
							dr(3) = result.Venue
						Else
							dr(3) = ""
						End If
						If result.Address <> Nothing Then
							dr(4) = result.Address
						Else
							dr(4) = ""
						End If
						If result.City <> Nothing Then
							dr(5) = result.City
						Else
							dr(5) = ""
						End If
						If result.ZipCode <> Nothing Then
							dr(6) = result.ZipCode
						Else
							dr(6) = ""
						End If
						If result.Cost <> Nothing Then
							dr(7) = result.Cost
						Else
							dr(7) = ""
						End If
						If result.Details <> Nothing Then
							dr(8) = result.Details
						Else
							dr(8) = ""
						End If
						If usr.ID = grp.Uid Then
							dr(9) = True
						Else
							dr(9) = False
						End If
						dt.Rows.Add(dr)
					End If
					System.Math.Max(System.Threading.Interlocked.Increment(counter),counter - 1)
				Next
			End If
			Dim dv As New DataView(dt)
			Return dv
		End Function

		Protected Sub BindGrid()
			' init datagrid with database data 
			dgGroupEvents.DataSource = CreateDataSource()
			dgGroupEvents.DataBind()
		End Sub

		Private Sub cvHtmlInVenue_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
			Dim gn As String = Request.Form(txtVenue.UniqueID)

			If isHTML(gn) Then
				args.IsValid = False
			Else
				args.IsValid = True
			End If
		End Sub

		Private Sub cvHtmlInCost_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
			Dim gn As String = Request.Form(txtCost.UniqueID)

			If isHTML(gn) Then
				args.IsValid = False
			Else
				args.IsValid = True
			End If
		End Sub

		Private Sub cvHtmlInAddress_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
			Dim gn As String = Request.Form(txtAddress.UniqueID)

			If isHTML(gn) Then
				args.IsValid = False
			Else
				args.IsValid = True
			End If
		End Sub

		Private Sub cvHtmlInCity_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
			Dim gn As String = Request.Form(txtCity.UniqueID)

			If isHTML(gn) Then
				args.IsValid = False
			Else
				args.IsValid = True
			End If
		End Sub

		Private Sub cvHtmlInZipCode_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
			Dim gn As String = Request.Form(txtZipCode.UniqueID)

			If isHTML(gn) Then
				args.IsValid = False
			Else
				args.IsValid = True
			End If
		End Sub

		====================
        ' This public property was added by conversion wizard to allow the access of a protected, autogenerated member variable Form1.
		====================
        Public ReadOnly Property Form1() As System.Web.UI.HtmlControls.HtmlForm
            Get
                Return Migrated_Form1
            End Get
        End Property
        'set { Migrated_Form1 = value; }
    End Class
End Namespace






